import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		token: '',			// 用户token
		user: {
			username: '',	// 用户姓名
			phone: '',		// 用户电话
			email: '',		// 用户邮箱
		},
	},
	mutations: {
		setToken(state, token){
			state.token = token;
		},
		setUser(state, user){
			state.user = user;
		},
	},
	actions: {

	},
	getters:{
		getToken(state){
			return state.token
		},
		getUser(state){
			return state.user
		},
	}
})

export default store